﻿<%@ Page Title="用户注册申请审批" Language="C#" MasterPageFile="~/masterPage/admin/Manage.master"
    AutoEventWireup="true" CodeFile="UserVerified.aspx.cs" Inherits="Management_Moderation_UserVerified" %>

<%@ MasterType VirtualPath="~/masterPage/admin/Manage.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rmpContent">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rmpContent"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="rgridVendors" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="rgridBuyers" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="rgridInquiry" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgridVendors">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgridVendors"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgridBuyers">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgridBuyers"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgridInquiry">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgridInquiry"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadTabStrip ID="rtsNavigator" runat="server" MultiPageID="rmpContent">
        <Tabs>
            <telerik:RadTab runat="server" Text="供应商审核" Selected="true">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="采购商审核">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="询盘审核">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="rmpContent" runat="server">
        <telerik:RadPageView ID="rpvModerateVendor" runat="server" Selected="true">
            <telerik:RadGrid ID="rgridVendors" runat="server" Width="90%" ShowStatusBar="true"
                AllowPaging="True" AutoGenerateColumns="False" GridLines="None" DataSourceID="odsVendors"
                OnItemCommand="rgridVendors_ItemCommand">
                <MasterTableView DataSourceID="odsVendors" DataKeyNames="CompanyID">
                    <Columns>
                        <telerik:GridBoundColumn DataField="CreateDate" HeaderText="提交时间" UniqueName="CreateDate">
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="CompanyName" HeaderText="公司名称" UniqueName="CompanyName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OfficePhone" HeaderText="公司电话" UniqueName="OfficePhone">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="电话有效性" DataField="OfficePhoneValidate">
                            <ItemTemplate>
                                <asp:ImageButton ID="OfficePhoneValidate" BorderWidth="0px" CommandName="validateop"
                                    ImageUrl='<%# (bool)Eval("OfficePhoneValidate")? "~/images/backImg/ok.png": "~/images/backImg/blank_ok.png" %>'
                                    ToolTip='<%# (bool)Eval("OfficePhoneValidate")? "点击更改为无效": "点击更改为有效" %>' AlternateText="验证"
                                    Style="cursor: pointer;" runat="server"></asp:ImageButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="CellPhone" HeaderText="手机号码" UniqueName="CellPhone">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Fax" HeaderText="传真" UniqueName="Fax">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Province" HeaderText="省份" UniqueName="Province">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="City" HeaderText="城市" UniqueName="City">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Address" HeaderText="地址" UniqueName="Address">
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="approve" Text="批准"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmTitle="确认批准" ConfirmText="确认您要批准该供应商申请么"
                            ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="reject" Text="拒绝"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmTitle="确认拒绝" ConfirmText="确认您要拒绝该供应商申请么"
                            ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                    </Columns>
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="CertID" DataSourceID="sdsCompanyCert" Width="100%"
                            runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="CompanyID" MasterKeyField="CompanyID" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn HeaderText="名称" DataField="CertName" UniqueName="CertName">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="downloadfile" DataTextField="CertFileName"
                                    HeaderText="证书文件/附件" UniqueName="CertFileName">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <NoRecordsTemplate>
                                该供应商未上传任何执照和任何资质证书及附件
                            </NoRecordsTemplate>
                        </telerik:GridTableView>
                    </DetailTables>
                    <PagerStyle FirstPageToolTip="首页" LastPageToolTip="末页" NextPagesToolTip="下页" PrevPagesToolTip="上页"
                        ShowPagerText="false" PageSizeLabelText="每页显示:" />
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadPageView>
        <telerik:RadPageView ID="rpvModerateBuyer" runat="server">
            <telerik:RadGrid ID="rgridBuyers" runat="server" Width="90%" AllowPaging="True" AutoGenerateColumns="False"
                GridLines="None" DataSourceID="odsBuyers" OnItemCommand="rgridBuyers_ItemCommand">
                <MasterTableView DataKeyNames="CompanyID">
                    <Columns>
                        <telerik:GridBoundColumn DataField="CreateDate" HeaderText="提交时间" UniqueName="CreateDate">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CompanyName" HeaderText="公司名称" UniqueName="CompanyName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OfficePhone" HeaderText="公司电话" UniqueName="OfficePhone">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="电话有效性" DataField="OfficePhoneValidate">
                            <ItemTemplate>
                                <asp:ImageButton ID="OfficePhoneValidate" BorderWidth="0px" CommandName="validateop"
                                    ImageUrl='<%# (bool)Eval("OfficePhoneValidate")? "~/images/backImg/ok.png": "~/images/backImg/blank_ok.png" %>'
                                    ToolTip='<%# (bool)Eval("OfficePhoneValidate")? "点击更改为无效": "点击更改为有效" %>' AlternateText="验证"
                                    Style="cursor: pointer;" runat="server"></asp:ImageButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="CellPhone" HeaderText="手机号码" UniqueName="CellPhone">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Fax" HeaderText="传真" UniqueName="Fax">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Province" HeaderText="省份" UniqueName="Province">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="City" HeaderText="城市" UniqueName="City">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Address" HeaderText="地址" UniqueName="Address">
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="approve" Text="批准"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmTitle="确认批准" ConfirmText="确认您要批准该采购商申请么"
                            ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="reject" Text="拒绝"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmTitle="确认拒绝" ConfirmText="确认您要拒绝该采购商申请么"
                            ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                    </Columns>
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="CertID" DataSourceID="sdsCompanyCert" Width="100%"
                            runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="CompanyID" MasterKeyField="CompanyID" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn HeaderText="名称" DataField="CertName" UniqueName="CertName">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="downloadfile" DataTextField="CertFileName"
                                    HeaderText="证书文件/附件" UniqueName="CertFileName">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <NoRecordsTemplate>
                                该供应商未上传任何执照和任何资质证书及附件
                            </NoRecordsTemplate>
                        </telerik:GridTableView>
                    </DetailTables>
                    <PagerStyle AlwaysVisible="true" FirstPageToolTip="首页" LastPageToolTip="末页" NextPagesToolTip="下页"
                        PrevPagesToolTip="上页" ShowPagerText="false" PageSizeLabelText="每页显示:" />
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadPageView>
        <telerik:RadPageView ID="rpvInquiry" runat="server">
            <telerik:RadGrid ID="rgridInquiry" runat="server" Width="90%" AllowPaging="true"
                AutoGenerateColumns="false" GridLines="None" DataSourceID="odsInquiry" OnItemCommand="rgridInquiry_ItemCommand">
                <MasterTableView DataSourceID="odsInquiry" DataKeyNames="InquiryID">
                    <Columns>
                        <telerik:GridBoundColumn DataField="CreateDate" HeaderText="提交时间" UniqueName="CreateDate">
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="CompanyName" HeaderText="采购商" UniqueName="CompanyName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PartName" HeaderText="采购产品" UniqueName="PartName">
                        </telerik:GridBoundColumn>
                        <%--<telerik:GridBoundColumn DataField="InquiryType" HeaderText="采购类型" UniqueName="InquiryType"></telerik:GridBoundColumn>--%>
                        <telerik:GridTemplateColumn HeaderText="询盘方式" DataField="IsPublic">
                            <ItemTemplate>
                                <asp:Label ID="lbIsPublic" runat="server" Text='<%# (bool)Eval("IsPublic")? "公开": "特定" %>'
                                    CommandName="IsPublic" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="报价截止日期" DataField="ExpireDate">
                            <ItemTemplate>
                                <asp:Label ID="lbExpire" runat="server" Text='<% #Eval("ExpireDate","{0:MM/dd/yyyy}") %>'
                                    CommandName="ExpireDate" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="授盘期限" DataField="AssignDate">
                            <ItemTemplate>
                                <asp:Label ID="lbAssign" runat="server" Text='<% #Eval("AssignDate","{0:MM/dd/yyyy}") %>'
                                    CommandName="AssignDate" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="交货期限" DataField="DeliveryDate">
                            <ItemTemplate>
                                <asp:Label ID="lbDelivery" runat="server" Text='<% #Eval("DeliveryDate","{0:MM/dd/yyyy}") %>'
                                    CommandName="DeliveryDate" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="approve" Text="批准"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmTitle="确认批准" ConfirmText="确认您要批准该询盘么"
                            ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="reject" Text="拒绝"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmTitle="确认拒绝" ConfirmText="确认您要拒绝该询盘么"
                            ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                    </Columns>
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="InquiryID" DataSourceID="sdsInquiryDetail" Width="100%"
                            runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="InquiryID" MasterKeyField="InquiryID" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn HeaderText="产品描述" DataField="PartDescription" UniqueName="PartDescription">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="价格1" DataField="Quantity1" UniqueName="Quantity1">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="价格2" DataField="Quantity2" UniqueName="Quantity2">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="价格3" DataField="Quantity3" UniqueName="Quantity3">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="单位" DataField="Unit" UniqueName="Unit">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="用户名" DataField="UserName" UniqueName="UserName">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <NoRecordsTemplate>
                                该供应商未上传任何执照和任何资质证书及附件
                            </NoRecordsTemplate>
                        </telerik:GridTableView>
                    </DetailTables>
                    <%--<DetailTables>
                        <telerik:GridTableView DataKeyNames="CertID" DataSourceID="sdsCompanyCert" Width="100%" runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="CompanyID" MasterKeyField="CompanyID" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn HeaderText="名称" DataField="CertName" UniqueName="CertName"></telerik:GridBoundColumn>
                                <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="downloadfile" DataTextField="CertFileName" HeaderText="证书文件/附件" UniqueName="CertFileName"></telerik:GridButtonColumn> 
                            </Columns>
                            <NoRecordsTemplate>
                            该供应商未上传任何执照和任何资质证书及附件
                            </NoRecordsTemplate>
                        </telerik:GridTableView>
                    </DetailTables>--%>
                    <PagerStyle AlwaysVisible="true" FirstPageToolTip="首页" LastPageToolTip="末页" NextPagesToolTip="下页"
                        PrevPagesToolTip="上页" ShowPagerText="false" PageSizeLabelText="每页显示:" />
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    <%--<asp:ObjectDataSource ID="odsVendors" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="SelectDynamic" 
        TypeName="SalePartial.BLL.XPCompany">
        <SelectParameters>
            <asp:Parameter DefaultValue="VendorModerateStatus = 0" Type="String" Name="v_whereCondition" />
            <asp:Parameter DefaultValue="" Name="v_orderByExpression" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="odsBuyers" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="SelectDynamic" 
        TypeName="SalePartial.BLL.XPCompany">
        <SelectParameters>
            <asp:Parameter DefaultValue="BuyerModerateStatus = 0" Type="String" Name="v_whereCondition" />
            <asp:Parameter DefaultValue="" Name="v_orderByExpression" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>--%>
    <%-- ning start   显示的数据中省份、城市、地址用该调用表【XPUserProfile】中相应字段  --%>
    <asp:SqlDataSource ID="odsBuyers" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT C.CompanyID,C.CreateDate,C.CompanyName,I.Country, I.Province,I.City,Address,C.OfficePhone,C.CellPhone,C.OfficePhoneValidate,C.CellPhoneValidate,C.Fax,C.FaxValidate
                FROM XPUserProfile I,XPCompany C where I.UserID = C.UserID  and BuyerModerateStatus='0' ORDER BY C.CreateDate">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="odsVendors" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT C.CompanyID,C.CreateDate,C.CompanyName,I.Country, I.Province,I.City,Address,C.OfficePhone,C.CellPhone,C.OfficePhoneValidate,C.CellPhoneValidate,C.Fax,C.FaxValidate
                FROM XPUserProfile I,XPCompany C where I.UserID = C.UserID  and  VendorModerateStatus='0' ORDER BY C.CreateDate">
    </asp:SqlDataSource>
    <%-- ning end--%>
    <asp:SqlDataSource ID="odsInquiry" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT I.CreateDate,I.InquiryID,C.CompanyName, I.PartName,  I.IsPublic, I.ExpireDate, I.AssignDate, I.DeliveryDate 
                FROM XPInquiry I,XPCompany C where I.CompanyID = C.CompanyID and I.InquiryStatus='0100000' order by I.CreateDate">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsInquiryTitle" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT [InquiryID], [InquiryStatus], [PartName], [CreateDate], [lbIsPublic], [lbExpire], [lbAssign], [lbDelivery] FROM [XPInquiry] WHERE ([InquiryStatus] = @InquiryStatus)">
        <SelectParameters>
            <asp:Parameter DefaultValue="{0:**0****}" Name="InquiryStatus" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsInquiryDetail" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT I.InquiryID, I.PartDescription, I.Quantity1, I.Quantity2, I.Quantity3, I.Unit,U.UserName FROM XPInquiry I,aspnet_Users U where  I.InquiryID = @InquiryID and U.UserId = I.UserID">
        <SelectParameters>
            <asp:SessionParameter Name="InquiryID" SessionField="InquiryID" DbType="Guid" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsCompanyCert" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT [CertID], [CompanyID], [CertType], [CertName], [CertFileName], [CertFileContentType], [CertFileSize], [ModerateStatus] FROM [vw_XPCompanyCerts] WHERE ([CompanyID] = @CompanyID)">
        <SelectParameters>
            <asp:SessionParameter Name="CompanyID" SessionField="CompanyID" DbType="Guid" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
